<template>
  <div class="anchorDj" v-if="anchordjList">
    <p class="titleDj">电台</p>
    <template v-for="item in anchordjList">
      <div class="contentBox" :key="item.id" @click="goAnchordjList(item,item.id)">
        <div class="imgBox">
          <img :src="item.picUrl" alt />
        </div>
        <div class="text">
          <p>{{item.name}}</p>
          <span>{{item.dj.nickname}}</span>
        </div>
      </div>
    </template>
  </div>
</template>

<script>
export default {
  components: {},
  props: ["singerName"],
  data() {
    return {
      anchordjList:""
    };
  },
  watch: {
    singerName: function() {
      this.$http("/search", {
      params: {
        keywords: this.singerName,
        type: 1009
      }
    }).then(res => {
      console.log(res);
      this.anchordjList = res.data.result.djRadios;
    });
    }
  },
  computed: {},
  methods: {
    goAnchordjList(item,id){
      console.log(item,id);
      this.$router.push({
        name:"show",
        query:{
          ids:id
        }
      })
    }
  },
  created() {
    this.$http("/search", {
      params: {
        keywords: this.singerName,
        type: 1009
      }
    }).then(res => {
      console.log(res);
      this.anchordjList = res.data.result.djRadios;
    });
  },
  mounted() {
    console.log(this.anchordjList);
  }
};
</script>
<style lang="scss" scoped>
@import "~@/assets/css/common.scss";
.anchorDj {
  padding: vw(10);
  .titleDj {
    font-size: vw(16);
    font-weight: bold;
  }
  .contentBox {
    width: 100%;
    display: flex;
    align-items: center;
    padding: vw(10) 0;
    .imgBox {
      width: vw(50);
      height: vw(50);
      border-radius: vw(5);
      overflow: hidden;
      img {
        width: 100%;
      }
    }
    .text {
      padding-left: vw(10);
      p {
        font-size: vw(16);
        padding-bottom: vw(4);
      }
      span {
        font-size: vw(14);
        color: #777;
      }
    }
  }
}
</style>